using System.Collections.Generic;
using System.IO;
using NUnit.Framework;

namespace projectfile.tests
{
    [TestFixture]
    public class IntegrationsTests
    {
        private GetEbcXmlFilenames sut;
        private IEnumerable<string> result;

        [SetUp]
        public void Setup() {
            sut = new GetEbcXmlFilenames(new ProjectReader(), new ProjectParser());
            sut.Result += x => result = x;
        }

        [Test]
        public void Ebc_Dateien_aus_Projekt_ermitteln() {
            const string filename = @"..\..\projectfile.tests.csproj";
            var path = Path.GetDirectoryName(Path.GetFullPath(filename));

            sut.Process(filename);
            
            Assert.That(result, Is.EquivalentTo(new[] {
                Path.Combine(path, @"Testdata\Ebcs\a.ebc.xml"), 
                Path.Combine(path, @"Testdata\Ebcs\b.ebc.xml")
            }));
        }
    }
}